

//设置路由信息
// import Home from "@/pages/Home"
// import Login from "@/pages/Login"
// import Register from "@/pages/Register"
// import Search from "@/pages/Search"
// import Detail from "@/pages/Detail"
// import AddCartSuccess from "@/pages/AddCartSuccess"
// import ShopCart from '@/pages/ShopCart'
// import Center from "@/pages/Center"
// import Pay from "@/pages/Pay"
// import PaySuccess from "@/pages/PaySuccess"
// import Trade from "@/pages/Trade"
//路由懒加载
const Home=()=>import('@/pages/Home')
const Login=()=>import ('@/pages/Login')
const Register=()=>import('@/pages/Register')
const Search=()=>import('@/pages/Search')
const Detail=()=>import('@/pages/Detail')
const AddCartSuccess=()=>import('@/pages/AddCartSuccess')
const ShopCart=()=>import('@/pages/ShopCart')
const  Center=()=>import ('@/pages/Center')
const Pay=()=>import ('@/pages/Pay')
const PaySuccess=()=>import('@/pages/PaySuccess')
const Trade=()=>import('@/pages/Trade')


export default [

  {
    name:'home',
    path: '/home',
    component:Home,
    meta:{
      isHiddenNav:true//是否显示左侧导航
    }
   
  },
  {name:'login',
    path: '/login',
    component:Login,
    meta:{
      isHiddenFooter:true,
    }
  },
  {
    name:'register',
    path: '/register',
    component:Register,
    meta:{
      isHiddenFooter:true,
    }
  },
  {name:'search',
    path: '/search/:keyword?',
    component:Search
  },
  {name:'detail',
  path: "/detail/:id",
  component:Detail,
  props:true,//可以使用props接受我的params参数
},

{
  //购物车成功界面
  name:'addCartSuccess',
  path: "/addCartSuccess",
  component:AddCartSuccess,
 
},
{
  //购物车界面
  name:"shopCart",
  path:"/shopCart",
  component:ShopCart
},
{
  //结算中心
  name:"trade",
  path:"/trade",
  component:Trade
},
{
  //支付中心
  name:"pay",
  path:"/pay",
  component:Pay
},
{
  //支付成功界面
  name:"paySuccess",
  path:"/paySuccess",
  component:PaySuccess
},
{
  //订单中心界面
  name:"center",
  path:"/center",
  component:Center
},
  {
    path: '/',
    redirect:'/home' // 重定向到主页面
  }
]